<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/4/6
 * Time: 20:55
 */


require_once "../config/database.php";
require_once "adminDb.php";
$AdminDb=new AdminDb();
$user=$_POST['user'];
$content=$_POST['content'];
$title=$_POST['title'];
$addtime=time();
$data = $AdminDb->addNotice($user,$content,$title,$addtime);

    try {
        $result = $data;
        if ($result) {
            $dat = array(
                'message' =>"发布成功",
            );
            echo json_encode($dat);
        } else {
            $dat = array(

                'message' =>"发布失败",

            );
            echo json_encode($dat);

        }
    }
    catch (Exception $e) {
        echo $e->getMessage();}




